﻿using System;

namespace Eniux.SharpOpenGL
{
    /// <summary>
    /// 渲染上下文接口
    /// </summary>
    public interface IRenderContext : IDisposable
    {

        #region 属性

        /// <summary>
        /// 获取上下文句柄
        /// </summary>
        IntPtr RenderContextHandle
        {
            get;
        }

        /// <summary>
        /// 获取设备句柄
        /// </summary>
        IntPtr DeviceContextHandle
        {
            get;
        }

        /// <summary>
        /// 获取宽度
        /// </summary>
        /// <value>宽度</value>
        int Width
        {
            get;
        }

        /// <summary>
        /// 获取高度
        /// </summary>
        /// <value>高度</value>
        int Height
        {
            get;
        }

        /// <summary>
        /// 获取位深
        /// </summary>
        /// <value>位深</value>
        int BitDepth
        {
            get;
        }

        /// <summary>
        /// 获取一个值，指示GDI绘制是否可用
        /// </summary>
        /// <value>bool</value>
        bool GDIDrawingEnabled
        {
            get;
        }

        #endregion

        #region 方法

        /// <summary>
        /// 创建渲染上下文
        /// </summary>
        /// <param name="gl">OpenGL上下文</param>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        /// <param name="bitDepth">位深</param>
        /// <param name="parameter">参数</param>
        /// <returns>bool</returns>
        bool Create(OpenGL gl, int width, int height, int bitDepth, object parameter);

        /// <summary>
        /// 销毁渲染上下文
        /// </summary>
        void Destroy();

        /// <summary>
        ///设置渲染上下文尺寸.
        /// </summary>
        /// <param name="width">宽度</param>
        /// <param name="height">高度</param>
        void SetDimensions(int width, int height);

        /// <summary>
        /// 确定渲染当前上下文
        /// </summary>
        void MakeCurrent();

        /// <summary>
        ///将呈现位块的数据给上下文.
        /// </summary>
        /// <param name="hdc">The HDC.</param>
        void Blit(IntPtr hdc); 

        #endregion

    }
}
